package com.wust.controller;

import com.wust.common.ServerResponse;
import com.wust.entity.CheckupRecord;
import com.wust.service.IRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Created by lenovo on 2018/5/30.
 */
@RestController
@RequestMapping("/api/record")
@EnableSwagger2
@Api(value = "record", description = "记录接口")
public class RecordController {

    @Autowired
    private IRecordService iRecordService;

    //获取当前最新的一条记录
    @ApiOperation(value = "获取某一用户当前最新的一条记录")
    @PostMapping("/dogetLatestRecord")
    public ServerResponse<CheckupRecord> getLatestRecord(String userId){
        return iRecordService.getLatestRecord(Integer.valueOf(userId));
    }

//    //获取测试最新的一条记录
//    @ApiOperation(value = "获取某一用户当前最新的一条记录（测试使用）")
//    @PostMapping("/dogetLatestRecordTest")
//    public ServerResponse<CheckupRecord> getLatestRecordTest(String userId){
//        return iRecordService.getLatestRecordTest(Integer.valueOf(userId));
//    }


//    //获取月统计结果
//    @ApiOperation(value = "获取某一用户一月的统计结果")
//    @PostMapping("/dogetMonthStatistics")
//    public ServerResponse getMonthStatistics(String userId){
//        return null;
//    }


}
